package com.wcar.store.controller;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.wcar.common.entity.StoreLabels;
import com.wcar.common.vo.Result;
import com.wcar.store.service.LablesService;
import com.wcar.store.vo.StoreVo;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;

/**
 * @BelongsProject: four-wcar-idea
 * @BelongsPackage: com.wcar.store.controller
 * @Author: 李睢康
 * @CreateTime: 2024-05-28  18:40
 */
@RestController
@RequestMapping("/store/labels")
public class StoreLabelsController {
    @Resource
    private LablesService lablesService;
    @PostMapping("/api/selectLabels")
    public Result<IPage> getAll(@RequestBody StoreVo storeVo){
        return lablesService.getAll(storeVo);
    }

    @PostMapping("/api/insertLabels")
    public Result<Integer> insert(@RequestBody StoreLabels storeLables){
        return lablesService.insert(storeLables);
    }
    @PostMapping("/api/updateLabels")
    public Result<Integer> update(@RequestBody StoreLabels storeLabels){
        return lablesService.update(storeLabels);
    }

    @GetMapping("/api/deleteLabels")
    public Result<Integer> delete(Integer labelId){
        return lablesService.delete(labelId);
    }
}
